#tag Window
Begin Window winAIRun
   BackColor       =   &hFFFFFF
   Backdrop        =   ""
   BalloonHelp     =   ""
   CloseButton     =   "False"
   Composite       =   "False"
   Frame           =   0
   FullScreen      =   "False"
   HasBackColor    =   "False"
   Height          =   609
   ImplicitInstance=   "True"
   LiveResize      =   "False"
   MacProcID       =   0
   MaxHeight       =   32000
   MaximizeButton  =   "False"
   MaxWidth        =   32000
   MenuBar         =   1223507315
   MenuBarVisible  =   "True"
   MinHeight       =   64
   MinimizeButton  =   "True"
   MinWidth        =   64
   Placement       =   0
   Resizeable      =   "False"
   Title           =   "Medievo AI-Runner"
   Visible         =   "True"
   Width           =   500
   Begin EditField edtAILog
      AcceptTabs      =   ""
      Alignment       =   0
      AutoDeactivate  =   "True"
      BackColor       =   &hFFFFFF
      Bold            =   ""
      Border          =   "True"
      ControlOrder    =   0
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Format          =   ""
      Height          =   237
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LimitText       =   0
      LockBottom      =   "True"
      LockLeft        =   "True"
      LockRight       =   "True"
      LockTop         =   ""
      Mask            =   ""
      Multiline       =   "True"
      Password        =   ""
      ReadOnly        =   ""
      Scope           =   0
      ScrollbarHorizontal=   "True"
      ScrollbarVertical=   "True"
      Styled          =   ""
      TabPanelIndex   =   0
      Text            =   ""
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   232
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   True
      Width           =   460
      BehaviorIndex   =   0
   End
   Begin PushButton btnGo
      AutoDeactivate  =   "True"
      Bold            =   ""
      Cancel          =   ""
      Caption         =   "Go!"
      ControlOrder    =   1
      Default         =   "True"
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   400
      LockBottom      =   "True"
      LockLeft        =   ""
      LockRight       =   "True"
      LockTop         =   ""
      Scope           =   0
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   569
      Underline       =   ""
      Visible         =   True
      Width           =   80
      BehaviorIndex   =   1
   End
   Begin ProgressBar prgAI
      AutoDeactivate  =   "True"
      ControlOrder    =   2
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Left            =   86
      LockBottom      =   "True"
      LockLeft        =   "True"
      LockRight       =   "True"
      LockTop         =   ""
      Maximum         =   100
      Scope           =   0
      TabPanelIndex   =   0
      Top             =   168
      Value           =   0
      Visible         =   True
      Width           =   394
      BehaviorIndex   =   2
   End
   Begin StaticText StaticText1
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   3
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   "True"
      LockLeft        =   "True"
      LockRight       =   "True"
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Progress:"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   168
      Underline       =   ""
      Visible         =   True
      Width           =   100
      BehaviorIndex   =   3
   End
   Begin AlternateList lbxGames
      aRows           =   "true"
      AutoDeactivate  =   "True"
      AutoHideScrollbars=   "True"
      Bold            =   ""
      ColumnCount     =   1
      ColumnsResizable=   ""
      ColumnWidths    =   ""
      ControlOrder    =   4
      DataField       =   ""
      DataSource      =   ""
      DefaultRowHeight=   -1
      Enabled         =   "True"
      EnableDrag      =   ""
      EnableDragReorder=   ""
      GridLinesHorizontal=   0
      GridLinesVertical=   0
      HasHeading      =   ""
      HeadingIndex    =   -1
      Height          =   120
      HelpTag         =   ""
      Hierarchical    =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      InitialValue    =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      RequiresSelection=   ""
      Scope           =   0
      ScrollbarHorizontal=   ""
      ScrollBarVertical=   "True"
      SelectionType   =   0
      TabPanelIndex   =   0
      TextFont        =   "System"
      TextSize        =   0
      Top             =   42
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   "True"
      Width           =   460
      _ScrollOffset   =   0
      _ScrollWidth    =   -1
      BehaviorIndex   =   4
   End
   Begin StaticText StaticText2
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   5
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   185
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Score:"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   484
      Underline       =   ""
      Visible         =   True
      Width           =   54
      BehaviorIndex   =   5
   End
   Begin StaticText StaticText3
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   6
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Games"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   10
      Underline       =   ""
      Visible         =   True
      Width           =   100
      BehaviorIndex   =   6
   End
   Begin StaticText Gamelog
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   7
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Gamelog"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   200
      Underline       =   ""
      Visible         =   True
      Width           =   100
      BehaviorIndex   =   7
   End
   Begin EditField edtScoreAI1
      AcceptTabs      =   ""
      Alignment       =   0
      AutoDeactivate  =   "True"
      BackColor       =   &hFFFFFF
      Bold            =   ""
      Border          =   "True"
      ControlOrder    =   8
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   "False"
      Format          =   ""
      Height          =   22
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   251
      LimitText       =   0
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Mask            =   ""
      Multiline       =   ""
      Password        =   ""
      ReadOnly        =   ""
      Scope           =   0
      ScrollbarHorizontal=   ""
      ScrollbarVertical=   "True"
      Styled          =   ""
      TabPanelIndex   =   0
      Text            =   ""
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   483
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   True
      Width           =   80
      BehaviorIndex   =   8
   End
   Begin StaticText StaticText4
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   9
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   185
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Score:"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   516
      Underline       =   ""
      Visible         =   True
      Width           =   45
      BehaviorIndex   =   9
   End
   Begin EditField edtScoreAI2
      AcceptTabs      =   ""
      Alignment       =   0
      AutoDeactivate  =   "True"
      BackColor       =   &hFFFFFF
      Bold            =   ""
      Border          =   "True"
      ControlOrder    =   10
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   "False"
      Format          =   ""
      Height          =   22
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   251
      LimitText       =   0
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Mask            =   ""
      Multiline       =   ""
      Password        =   ""
      ReadOnly        =   ""
      Scope           =   0
      ScrollbarHorizontal=   ""
      ScrollbarVertical=   "True"
      Styled          =   ""
      TabPanelIndex   =   0
      Text            =   ""
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   515
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   True
      Width           =   80
      BehaviorIndex   =   10
   End
   Begin EditField edtMaxAI2
      AcceptTabs      =   ""
      Alignment       =   0
      AutoDeactivate  =   "True"
      BackColor       =   &hFFFFFF
      Bold            =   ""
      Border          =   "True"
      ControlOrder    =   11
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   "False"
      Format          =   ""
      Height          =   22
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   400
      LimitText       =   0
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Mask            =   ""
      Multiline       =   ""
      Password        =   ""
      ReadOnly        =   ""
      Scope           =   0
      ScrollbarHorizontal=   ""
      ScrollbarVertical=   "True"
      Styled          =   ""
      TabPanelIndex   =   0
      Text            =   ""
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   515
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   True
      Width           =   80
      BehaviorIndex   =   11
   End
   Begin EditField edtMaxAI1
      AcceptTabs      =   ""
      Alignment       =   0
      AutoDeactivate  =   "True"
      BackColor       =   &hFFFFFF
      Bold            =   ""
      Border          =   "True"
      ControlOrder    =   12
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   "False"
      Format          =   ""
      Height          =   22
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   398
      LimitText       =   0
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Mask            =   ""
      Multiline       =   ""
      Password        =   ""
      ReadOnly        =   ""
      Scope           =   0
      ScrollbarHorizontal=   ""
      ScrollbarVertical=   "True"
      Styled          =   ""
      TabPanelIndex   =   0
      Text            =   ""
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   483
      Underline       =   ""
      UseFocusRing    =   "True"
      Visible         =   True
      Width           =   80
      BehaviorIndex   =   12
   End
   Begin StaticText StaticText5
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   13
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   343
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Max:"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   484
      Underline       =   ""
      Visible         =   True
      Width           =   43
      BehaviorIndex   =   13
   End
   Begin StaticText StaticText6
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   14
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   343
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Max:"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   516
      Underline       =   ""
      Visible         =   True
      Width           =   45
      BehaviorIndex   =   14
   End
   Begin StaticText txtAI1Name
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   15
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   86
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   ""
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   485
      Underline       =   ""
      Visible         =   True
      Width           =   87
      BehaviorIndex   =   15
   End
   Begin StaticText txtAI2Name
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   16
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   86
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   ""
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   515
      Underline       =   ""
      Visible         =   True
      Width           =   87
      BehaviorIndex   =   16
   End
   Begin StaticText StaticText7
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   17
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Name:"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   484
      Underline       =   ""
      Visible         =   True
      Width           =   54
      BehaviorIndex   =   17
   End
   Begin StaticText StaticText8
      AutoDeactivate  =   "True"
      Bold            =   ""
      ControlOrder    =   18
      DataField       =   ""
      DataSource      =   ""
      Enabled         =   True
      Height          =   20
      HelpTag         =   ""
      Index           =   -2147483648
      InitialParent   =   ""
      Italic          =   ""
      Left            =   20
      LockBottom      =   ""
      LockLeft        =   ""
      LockRight       =   ""
      LockTop         =   ""
      Multiline       =   ""
      Scope           =   0
      TabPanelIndex   =   0
      Text            =   "Name:"
      TextAlign       =   0
      TextColor       =   &h000000
      TextFont        =   "System"
      TextSize        =   0
      Top             =   516
      Underline       =   ""
      Visible         =   True
      Width           =   54
      BehaviorIndex   =   18
   End
End
#tag EndWindow

#tag WindowCode
#tag MenuHandler
		Function RvD10(index as Integer) As Boolean Handles RvD10.Action
			runs = 10
			type = "RvD"
			
			Title = "Random AI vs Decission AI - 10 runs"
			
			Return True
			
		End Function
#tag EndMenuHandler

#tag MenuHandler
		Function RvD100(index as Integer) As Boolean Handles RvD100.Action
			runs = 100
			type = "RvD"
			Title = "Random AI vs Decission AI - 100 runs"
			
			Return True
			
		End Function
#tag EndMenuHandler


	#tag Property, Flags = &h0
		type As String
	#tag EndProperty

	#tag Property, Flags = &h0
		runs As Integer
	#tag EndProperty


#tag EndWindowCode

#tag Events btnGo
	#tag Event
		Sub Action()
		  AIRunner.Run
		End Sub
	#tag EndEvent
#tag EndEvents
#tag Events lbxGames
	#tag Event
		Sub Change()
		  dim i as integer
		  dim gf as GameFacade
		  dim game as game.Concretegame
		  gf = app.GetGameFacade
		  
		  
		  i = me.ListIndex
		  
		  game = gf.SetAIGameByIndex(i)
		  
		  
		  if game <> nil then
		    winAIRun.edtScoreAI1.Text = str(game.GetPlayerById(0).GetScore)
		    winAIRun.edtScoreAI2.Text = str(game.GetPlayerById(1).GetScore)
		  end if
		  
		  gf.ShowAIGame
		  
		exception err
		  
		  if err isA OutOfBoundsException then
		    msgbox "argh"
		  end if
		End Sub
	#tag EndEvent
#tag EndEvents
